<!DOCTYPE html><html class="theme-next muse use-motion" lang="zh-CN"><head><meta name="generator" content="Hexo 3.8.0"><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=2"><meta name="theme-color" content="#222"><script src="//cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script><link href="/lib/pace/pace-theme-corner-indicator.min.css?v=1.0.2" rel="stylesheet"><meta name="google-site-verification" content="sDeZZSmv4NPbU3sXi1IL5l8PiZt1wVqR5EKUsxOjruY"><link href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.2.5/dist/jquery.fancybox.min.css" rel="stylesheet" type="text/css"><link href="https://fonts.googleapis.cnpmjs.org/css?family=Noto Serif SC:300,300italic,400,400italic,700,700italic|Noto Serif SC:300,300italic,400,400italic,700,700italic|Roboto Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"><link href="//cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"><link href="/css/main.css?v=6.6.0" rel="stylesheet" type="text/css"><link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.6.0"><link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=6.6.0"><link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.6.0"><link rel="mask-icon" href="/images/logo.svg?v=6.6.0" color="#222"><script id="hexo.configurations">var NexT=window.NexT||{},CONFIG={root:"/",scheme:"Muse",version:"6.6.0",sidebar:{position:"left",display:"hide",offset:12,b2t:!1,scrollpercent:!0,onmobile:!0},fancybox:!0,fastclick:!1,lazyload:!1,tabs:!0,motion:{enable:!0,async:!1,transition:{post_block:"fadeIn",post_header:"slideDownIn",post_body:"slideDownIn",coll_header:"slideLeftIn",sidebar:"slideUpIn"}},algolia:{applicationID:"",apiKey:"",indexName:"",hits:{per_page:10},labels:{input_placeholder:"Search for Posts",hits_empty:"We didn't find any results for the search: ${query}",hits_stats:"${hits} results found in ${time} ms"}}}</script><meta name="description" content="Mac常用命令 序言熟练使用Mac终端操作的常用命令，可以让你更快、更加高效地进行系统操作，shell就是你的瑞士军刀"><meta name="keywords" content="diskutil,shell,spctl,trimforce,ioreg,EDID,APFS,HFS+"><meta property="og:type" content="article"><meta property="og:title" content="Mac常用到的命令[持续更新]"><meta property="og:url" content="https://blog.daliansky.net/Mac-frequently-used-to-the-command---continuous-update.html"><meta property="og:site_name" content="黑果小兵的部落阁"><meta property="og:description" content="Mac常用命令 序言熟练使用Mac终端操作的常用命令，可以让你更快、更加高效地进行系统操作，shell就是你的瑞士军刀"><meta property="og:locale" content="zh-CN"><meta property="og:image" content="https://pics.daliansky.net/d/xD0Ar91B/blog/EDID%E6%B3%A8%E5%85%A5.png?download=1"><meta property="og:image" content="https://pics.daliansky.net/d/xD0Ar91B/blog/HWP.png?download=1"><meta property="og:image" content="https://pics.daliansky.net/d/xD0Ar91B/blog/archey.png?download=1"><meta property="og:updated_time" content="2021-12-06T01:25:19.403Z"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="Mac常用到的命令[持续更新]"><meta name="twitter:description" content="Mac常用命令 序言熟练使用Mac终端操作的常用命令，可以让你更快、更加高效地进行系统操作，shell就是你的瑞士军刀"><meta name="twitter:image" content="https://pics.daliansky.net/d/xD0Ar91B/blog/EDID%E6%B3%A8%E5%85%A5.png?download=1"><link rel="alternate" href="/atom.xml" title="黑果小兵的部落阁" type="application/atom+xml"><link rel="canonical" href="https://blog.daliansky.net/Mac-frequently-used-to-the-command---continuous-update.html"><script id="page.configurations">CONFIG.page={sidebar:""}</script><title>Mac常用到的命令[持续更新] | 黑果小兵的部落阁</title><script async src="https://www.googletagmanager.com/gtag/js?id=UA-18130737-1"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-18130737-1")</script><noscript><style>.sidebar-inner,.use-motion .brand,.use-motion .collection-title,.use-motion .comments,.use-motion .menu-item,.use-motion .motion-element,.use-motion .pagination,.use-motion .post-block,.use-motion .post-body,.use-motion .post-header{opacity:initial}.use-motion .logo,.use-motion .site-subtitle,.use-motion .site-title{opacity:initial;top:initial}.use-motion .logo-line-before i{left:initial}.use-motion .logo-line-after i{right:initial}</style></noscript></head><body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN"><div class="container sidebar-position-left page-post-detail"><div class="headband"></div><header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="header-inner"><div class="site-brand-wrapper"><div class="site-meta"><div class="custom-logo-site-title"><a href="/" class="brand" rel="start"><span class="logo-line-before"><i></i></span> <span class="site-title">黑果小兵的部落阁</span> <span class="logo-line-after"><i></i></span></a></div><p class="site-subtitle">Hackintosh安装镜像、教程及经验分享</p></div><div class="site-nav-toggle"><button aria-label="切换导航栏"><span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span></button></div></div><nav class="site-nav"><ul id="menu" class="menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i><br>首页</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i><br>归档</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i><br>分类</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i><br>标签</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i><br>关于</a></li><li class="menu-item menu-item-search"><a href="javascript:;" class="popup-trigger"><i class="menu-item-icon fa fa-search fa-fw"></i><br>搜索</a></li></ul><div class="site-search"><div class="popup search-popup local-search-popup"><div class="local-search-header clearfix"><span class="search-icon"><i class="fa fa-search"></i> </span><span class="popup-btn-close"><i class="fa fa-times-circle"></i></span><div class="local-search-input-wrapper"><input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input"></div></div><div id="local-search-result"></div></div></div></nav></div></header><a href="https://github.com/daliansky" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewbox="0 0 250 250" style="fill:#222;color:#fff;position:absolute;top:0;border:0;right:0" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"/><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin:130px 106px" class="octo-arm"/><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"/></svg></a><main id="main" class="main"><div class="main-inner"><div class="content-wrap"><div id="content" class="content"><div id="posts" class="posts-expand"><div class="reading-progress-bar"></div><article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"><div class="post-block"><link itemprop="mainEntityOfPage" href="https://blog.daliansky.net/Mac-frequently-used-to-the-command---continuous-update.html"><span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"><meta itemprop="name" content="黑果小兵"><meta itemprop="description" content="黑果小兵,daliansky,blog.daliansky.net,macOS,Hackintosh,黑苹果,linux"><meta itemprop="image" content="/images/avatar.png"></span><span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><meta itemprop="name" content="黑果小兵的部落阁"></span><header class="post-header"><h1 class="post-title" itemprop="name headline">Mac常用到的命令[持续更新]</h1><div class="post-meta"><span class="post-time"><span class="post-meta-item-icon"><i class="fa fa-calendar-o"></i> </span><time title="创建时间：2017-08-17 10:24:00" itemprop="dateCreated datePublished" datetime="2017-08-17T10:24:00+08:00">2017-08-17</time> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="fa fa-calendar-check-o"></i> </span><time title="修改时间：2021-12-06 09:25:19" itemprop="dateModified" datetime="2021-12-06T09:25:19+08:00">2021-12-06</time> </span><span class="post-category"><span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="fa fa-folder-o"></i> </span><span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/教程/" itemprop="url" rel="index"><span itemprop="name">教程</span></a></span> </span><span class="post-meta-divider">|</span> <span class="post-meta-item-icon" title="阅读次数"><i class="fa fa-eye"></i> <span class="busuanzi-value" id="busuanzi_value_page_pv"></span></span><div class="post-symbolscount"><span class="post-meta-item-icon"><i class="fa fa-file-word-o"></i> </span><span title="本文字数">11k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="fa fa-clock-o"></i> </span><span title="阅读时长">20 分钟</span></div></div></header><div class="post-body" itemprop="articleBody"><h1 id="mac常用命令"><a class="markdownIt-Anchor" href="#mac常用命令"></a> Mac常用命令</h1><h2 id="序言"><a class="markdownIt-Anchor" href="#序言"></a> 序言</h2><p>熟练使用Mac终端操作的常用命令，可以让你更快、更加高效地进行系统操作，shell就是你的瑞士军刀</p><a id="more"></a><h1 id="隐藏允许任何来源的应用选项问题"><a class="markdownIt-Anchor" href="#隐藏允许任何来源的应用选项问题"></a> 隐藏“允许任何来源的应用”选项问题</h1><blockquote><p>新的系统安装好后，通常你打开一个dmg文件准备安装的时候，系统会提示你<code>不允许打开未知来源的应用</code>，这是因为从macOS Sierra开始增强了GateKeeper的安全性，所以“<code>允许任何来源的应用</code>”选项被隐藏，目的在于避免除Mac AppStore和正规签名外的未知或未签名App在系统内被任意执行，从而威胁用户隐私和系统安全。但这也造成了很多不便。<br><strong>操作方法</strong>：打开终端，输入命令：</p></blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo spctl --master-disable</span><br></pre></td></tr></table></figure><p>验证口令后即可。</p><h1 id="重建缓存的命令"><a class="markdownIt-Anchor" href="#重建缓存的命令"></a> 重建缓存的命令</h1><p>打开终端，输入命令：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/sh</span></span><br><span class="line">sudo chmod -Rf 755 /S*/L*/E*</span><br><span class="line">sudo chown -Rf 0:0 /S*/L*/E*</span><br><span class="line">sudo chmod -Rf 755 /L*/E*</span><br><span class="line">sudo chown -Rf 0:0 /L*/E*</span><br><span class="line">sudo rm -Rf /S*/L*/PrelinkedKernels/*</span><br><span class="line">sudo rm -Rf /S*/L*/Caches/com.apple.kext.caches/*</span><br><span class="line">sudo touch -f /S*/L*/E*</span><br><span class="line">sudo touch -f /L*/E*</span><br><span class="line">sudo kextcache -Boot -U /</span><br></pre></td></tr></table></figure><h1 id="磁盘分区的基本操作教你将u盘上的efi复制到磁盘的efi分区"><a class="markdownIt-Anchor" href="#磁盘分区的基本操作教你将u盘上的efi复制到磁盘的efi分区"></a> 磁盘分区的基本操作：教你将U盘上的EFI复制到磁盘的EFI分区</h1><blockquote><p>新的系统安装成功后，EFI还位于U盘里，总不能一直挂着U盘使用系统吧。这个时候如果你想将U盘里的EFI复制到磁盘的EFI分区里，却苦于找不到看不见EFI分区，这个时候是该让<code>diskutil</code>登场了。</p></blockquote><p><code>diskutil</code>命令的基本用法：</p><h2 id="查看磁盘分区表"><a class="markdownIt-Anchor" href="#查看磁盘分区表"></a> 查看磁盘分区表</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">diskutil list</span><br></pre></td></tr></table></figure><p>/dev/disk0(internal, physical):</p><table><thead><tr><th>#:</th><th style="text-align:right">TYPE</th><th>NAME</th><th>SIZE</th><th>IDENTIFIER</th></tr></thead><tbody><tr><td>0:</td><td style="text-align:right">GUID_partition_scheme</td><td></td><td>256 GB</td><td>disk0</td></tr><tr><td>1:</td><td style="text-align:right">EFI</td><td>EFI</td><td>200 MB</td><td>disk0s1</td></tr><tr><td>2:</td><td style="text-align:right">Apple_HFS</td><td>MAC</td><td>128 GB</td><td>disk0s2</td></tr><tr><td>3:</td><td style="text-align:right">Microsoft Basic Data</td><td>WIN10</td><td>127.7 GB</td><td>disk0s3</td></tr></tbody></table><p>/dev/disk1(internal, physical):</p><table><thead><tr><th>#:</th><th style="text-align:right">TYPE</th><th>NAME</th><th>SIZE</th><th>IDENTIFIER</th></tr></thead><tbody><tr><td>0:</td><td style="text-align:right">GUID_partition_scheme</td><td></td><td>16 GB</td><td>disk1</td></tr><tr><td>1:</td><td style="text-align:right">EFI</td><td>EFI</td><td>200 MB</td><td>disk1s1</td></tr><tr><td>2:</td><td style="text-align:right">Apple_HFS</td><td>Install macOS Sierra</td><td>15.8 GB</td><td>disk1s2</td></tr></tbody></table><h2 id="挂载磁盘efi分区"><a class="markdownIt-Anchor" href="#挂载磁盘efi分区"></a> 挂载磁盘EFI分区</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">diskutil mount disk0s1</span><br></pre></td></tr></table></figure><h2 id="挂载u盘efi分区"><a class="markdownIt-Anchor" href="#挂载u盘efi分区"></a> 挂载U盘EFI分区</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">diskutil mount disk1s1</span><br></pre></td></tr></table></figure><h2 id="打开finder注意后面有个"><a class="markdownIt-Anchor" href="#打开finder注意后面有个"></a> 打开Finder，注意后面有个<code>.</code></h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">open .</span><br></pre></td></tr></table></figure><p>左侧会显示挂载了两个EFI分区，将U盘EFI目录全部复制到磁盘的EFI分区即可。</p><h2 id="收工"><a class="markdownIt-Anchor" href="#收工"></a> 收工</h2><h1 id="磁盘分区的进阶操作教你将apfs分区转换回hfs"><a class="markdownIt-Anchor" href="#磁盘分区的进阶操作教你将apfs分区转换回hfs"></a> 磁盘分区的进阶操作：教你将apfs分区转换回hfs+</h1><blockquote><p>随着macOS High Sierra发布日期的临近，苹果公司新推出的<code>apfs</code>文件格式已经频繁地出现在我们的面前，假如你还不了解<code>apfs</code>文件的前世今生，请阅读<a href="https://zh.wikipedia.org/wiki/%E8%8B%B9%E6%9E%9C%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F" target="_blank" rel="noopener">苹果文件系统</a>。<strong>友情提示：</strong> <em><code>APFS</code> 在 macOS High Sierra（10.13）之后将成为默认的文件格式</em><br>那么问题来了，万一我的分区格式已经是<code>apfs</code>，我想转换成<code>HFS+</code>有什么办法吗？当然可以了，只是这个命令隐藏得比较深，这个命令还是：<code>diskutil</code></p></blockquote><h2 id="diskutil命令的进阶操作"><a class="markdownIt-Anchor" href="#diskutil命令的进阶操作"></a> diskutil命令的进阶操作</h2><p>查看磁盘分区表：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">diskutil list</span><br></pre></td></tr></table></figure><p>/dev/disk0(internal, physical):</p><table><thead><tr><th>#:</th><th style="text-align:right">TYPE</th><th style="text-align:left">NAME</th><th>SIZE</th><th>IDENTIFIER</th></tr></thead><tbody><tr><td>0:</td><td style="text-align:right">GUID_partition_scheme</td><td style="text-align:left"></td><td>512 GB</td><td>disk0</td></tr><tr><td>1:</td><td style="text-align:right">EFI</td><td style="text-align:left">EFI</td><td>200 MB</td><td>disk0s1</td></tr><tr><td>2:</td><td style="text-align:right">Apple_HFS</td><td style="text-align:left">MAC</td><td>128 GB</td><td>disk0s2</td></tr><tr><td>…</td><td style="text-align:right">…</td><td style="text-align:left">…</td><td>…</td><td>…</td></tr><tr><td>10:</td><td style="text-align:right">Apple_APFS</td><td style="text-align:left">Container disk1</td><td>29.2 GB</td><td>disk0s10</td></tr></tbody></table><p>/dev/disk1 (synthesized):</p><table><thead><tr><th>#:</th><th style="text-align:right">TYPE</th><th style="text-align:left">NAME</th><th>SIZE</th><th>IDENTIFIER</th></tr></thead><tbody><tr><td>0:</td><td style="text-align:right">APFS Container Scheme</td><td style="text-align:left">-<br>Physical Store disk0s5</td><td>+29.2 GB</td><td>disk1</td></tr><tr><td>1:</td><td style="text-align:right">APFS Volume</td><td style="text-align:left">test</td><td>9.8 GB</td><td>disk1s1</td></tr><tr><td>2:</td><td style="text-align:right">APFS Volume</td><td style="text-align:left">Preboot</td><td>20.6 MB</td><td>disk1s2</td></tr><tr><td>3:</td><td style="text-align:right">APFS Volume</td><td style="text-align:left">Recovery</td><td>519.6 MB</td><td>disk1s3</td></tr><tr><td>4:</td><td style="text-align:right">APFS Volume</td><td style="text-align:left">VM</td><td>1.1 GB</td><td>disk1s4</td></tr></tbody></table><p>查看<code>apfs</code>分区表</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">diskutil apfs list</span><br></pre></td></tr></table></figure><p>显示结果：</p><figure class="highlight pgsql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br></pre></td><td class="code"><pre><span class="line">APFS Containers (<span class="number">2</span> <span class="built_in">found</span>)</span><br><span class="line">|</span><br><span class="line">+<span class="comment">-- Container disk1 90B9C430-E60A-4174-8F1B-B8ED6E486D8B</span></span><br><span class="line">|   ====================================================</span><br><span class="line">|   APFS Container Reference:     disk1</span><br><span class="line">|   Capacity Ceiling (Size):      <span class="number">29194424320</span> B (<span class="number">29.2</span> GB)</span><br><span class="line">|   Capacity <span class="keyword">In</span> Use <span class="keyword">By</span> Volumes:   <span class="number">11533049856</span> B (<span class="number">11.5</span> GB) (<span class="number">39.5</span>% used)</span><br><span class="line">|   Capacity Available:           <span class="number">17661374464</span> B (<span class="number">17.7</span> GB) (<span class="number">60.5</span>% free)</span><br><span class="line">|   |</span><br><span class="line">|   +-&lt; Physical Store disk0s10 CF77604A<span class="number">-0</span>F78<span class="number">-4512</span><span class="number">-9563</span>-AD2E944353C8</span><br><span class="line">|   |   <span class="comment">------------------------------------------------------------</span></span><br><span class="line">|   |   APFS Physical Store Disk:   disk0s10</span><br><span class="line">|   |   Size:                       <span class="number">29194424320</span> B (<span class="number">29.2</span> GB)</span><br><span class="line">|   |</span><br><span class="line">|   +-&gt; Volume disk1s1 <span class="number">12</span>C9B3A9<span class="number">-0</span>D9B<span class="number">-3E75</span>-B0EF-D829FFE4D438</span><br><span class="line">|   |   <span class="comment">---------------------------------------------------</span></span><br><span class="line">|   |   APFS Volume Disk (<span class="keyword">Role</span>):   disk1s1 (<span class="keyword">No</span> specific <span class="keyword">role</span>)</span><br><span class="line">|   |   <span class="type">Name</span>:                      test (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">|   |   Mount <span class="type">Point</span>:               /Volumes/test</span><br><span class="line">|   |   Capacity Consumed:         <span class="number">9848913920</span> B (<span class="number">9.8</span> GB)</span><br><span class="line">|   |   <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br><span class="line">|   |</span><br><span class="line">|   +-&gt; Volume disk1s2 <span class="number">2316</span>B0D9<span class="number">-6798</span><span class="number">-4564</span>-A3CE<span class="number">-5</span>C5D1124AE5B</span><br><span class="line">|   |   <span class="comment">---------------------------------------------------</span></span><br><span class="line">|   |   APFS Volume Disk (<span class="keyword">Role</span>):   disk1s2 (Preboot)</span><br><span class="line">|   |   <span class="type">Name</span>:                      Preboot (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">|   |   Mount <span class="type">Point</span>:               <span class="keyword">Not</span> Mounted</span><br><span class="line">|   |   Capacity Consumed:         <span class="number">20631552</span> B (<span class="number">20.6</span> MB)</span><br><span class="line">|   |   <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br><span class="line">|   |</span><br><span class="line">|   +-&gt; Volume disk1s3 <span class="number">1</span>B6EBD7A-EE58<span class="number">-48</span>A7<span class="number">-97</span>A8<span class="number">-4E31</span>C18BE5EC</span><br><span class="line">|   |   <span class="comment">---------------------------------------------------</span></span><br><span class="line">|   |   APFS Volume Disk (<span class="keyword">Role</span>):   disk1s3 (Recovery)</span><br><span class="line">|   |   <span class="type">Name</span>:                      Recovery (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">|   |   Mount <span class="type">Point</span>:               <span class="keyword">Not</span> Mounted</span><br><span class="line">|   |   Capacity Consumed:         <span class="number">519573504</span> B (<span class="number">519.6</span> MB)</span><br><span class="line">|   |   <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br><span class="line">|   |</span><br><span class="line">|   +-&gt; Volume disk1s4 <span class="number">560E6</span>B74<span class="number">-04</span>B3<span class="number">-4083</span><span class="number">-8730</span>-A7FB7A0116A2</span><br><span class="line">|       <span class="comment">---------------------------------------------------</span></span><br><span class="line">|       APFS Volume Disk (<span class="keyword">Role</span>):   disk1s4 (VM)</span><br><span class="line">|       <span class="type">Name</span>:                      VM (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">|       Mount <span class="type">Point</span>:               <span class="keyword">Not</span> Mounted</span><br><span class="line">|       Capacity Consumed:         <span class="number">1073762304</span> B (<span class="number">1.1</span> GB)</span><br><span class="line">|       <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br><span class="line">|</span><br><span class="line">+<span class="comment">-- Container disk2 15E113C0-6AC5-4DA5-960C-A29A3C3B418A</span></span><br><span class="line">    ====================================================</span><br><span class="line">    APFS Container Reference:     disk2</span><br><span class="line">    Capacity Ceiling (Size):      <span class="number">100411764736</span> B (<span class="number">100.4</span> GB)</span><br><span class="line">    Capacity <span class="keyword">In</span> Use <span class="keyword">By</span> Volumes:   <span class="number">59094196224</span> B (<span class="number">59.1</span> GB) (<span class="number">58.9</span>% used)</span><br><span class="line">    Capacity Available:           <span class="number">41317568512</span> B (<span class="number">41.3</span> GB) (<span class="number">41.1</span>% free)</span><br><span class="line">    |</span><br><span class="line">    +-&lt; Physical Store disk0s5 <span class="number">987E8152</span>-DD9D<span class="number">-4148</span><span class="number">-8314</span>-CDA8A28323D5</span><br><span class="line">    |   <span class="comment">-----------------------------------------------------------</span></span><br><span class="line">    |   APFS Physical Store Disk:   disk0s5</span><br><span class="line">    |   Size:                       <span class="number">100411764736</span> B (<span class="number">100.4</span> GB)</span><br><span class="line">    |</span><br><span class="line">    +-&gt; Volume disk2s1 <span class="number">931</span>C738D-C5A4<span class="number">-3</span>A43<span class="number">-823</span>A<span class="number">-210</span>C3E9AF123</span><br><span class="line">    |   <span class="comment">---------------------------------------------------</span></span><br><span class="line">    |   APFS Volume Disk (<span class="keyword">Role</span>):   disk2s1 (<span class="keyword">No</span> specific <span class="keyword">role</span>)</span><br><span class="line">    |   <span class="type">Name</span>:                      MAC (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">    |   Mount <span class="type">Point</span>:               /</span><br><span class="line">    |   Capacity Consumed:         <span class="number">57355460608</span> B (<span class="number">57.4</span> GB)</span><br><span class="line">    |   <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br><span class="line">    |</span><br><span class="line">    +-&gt; Volume disk2s2 <span class="number">95</span>F73DEF-D85F<span class="number">-4</span>F43-B35F-D8914ED4A95F</span><br><span class="line">    |   <span class="comment">---------------------------------------------------</span></span><br><span class="line">    |   APFS Volume Disk (<span class="keyword">Role</span>):   disk2s2 (Preboot)</span><br><span class="line">    |   <span class="type">Name</span>:                      Preboot (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">    |   Mount <span class="type">Point</span>:               <span class="keyword">Not</span> Mounted</span><br><span class="line">    |   Capacity Consumed:         <span class="number">20959232</span> B (<span class="number">21.0</span> MB)</span><br><span class="line">    |   <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br><span class="line">    |</span><br><span class="line">    +-&gt; Volume disk2s3 CDF460DC<span class="number">-38</span>FE<span class="number">-4E79</span>-A04C-C7A5242BD091</span><br><span class="line">    |   <span class="comment">---------------------------------------------------</span></span><br><span class="line">    |   APFS Volume Disk (<span class="keyword">Role</span>):   disk2s3 (Recovery)</span><br><span class="line">    |   <span class="type">Name</span>:                      Recovery (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">    |   Mount <span class="type">Point</span>:               <span class="keyword">Not</span> Mounted</span><br><span class="line">    |   Capacity Consumed:         <span class="number">519573504</span> B (<span class="number">519.6</span> MB)</span><br><span class="line">    |   <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br><span class="line">    |</span><br><span class="line">    +-&gt; Volume disk2s4 <span class="number">25</span>CC995F-FB04<span class="number">-4617</span><span class="number">-900</span>A<span class="number">-955</span>B423A675F</span><br><span class="line">        <span class="comment">---------------------------------------------------</span></span><br><span class="line">        APFS Volume Disk (<span class="keyword">Role</span>):   disk2s4 (VM)</span><br><span class="line">        <span class="type">Name</span>:                      VM (<span class="keyword">Case</span>-insensitive)</span><br><span class="line">        Mount <span class="type">Point</span>:               /private/var/vm</span><br><span class="line">        Capacity Consumed:         <span class="number">1073762304</span> B (<span class="number">1.1</span> GB)</span><br><span class="line">        <span class="keyword">Encrypted</span>:                 <span class="keyword">No</span></span><br></pre></td></tr></table></figure><p>以我的磁盘为例：我的磁盘中存在两个<code>APFS</code>容器，分别是：<code>Container disk1</code>和<code>Container disk2</code>，disk1对应的是我的test卷，它是我测试用的，我演示下使用<code>diskutil</code>命令将<code>apfs</code>转换为<code>hfs+</code>，并且将转换的<code>hfs+</code>分区重新命名为：test<br><strong>[提示:]执行该命令之前请保存你的数据，该命令会直接删除之前该分区存在的数据</strong></p><h2 id="命令"><a class="markdownIt-Anchor" href="#命令"></a> 命令：</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">diskutil apfs deleteContainer disk1 <span class="built_in">test</span></span><br></pre></td></tr></table></figure><p>显示结果：</p><figure class="highlight livecodeserver"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">Started APFS operation <span class="keyword">on</span> <span class="title">disk1</span></span><br><span class="line">Deleting APFS Container <span class="keyword">with</span> all <span class="keyword">of</span> its APFS Volumes</span><br><span class="line">Unmounting Volumes</span><br><span class="line">Unmounting Volume <span class="string">"test"</span> <span class="keyword">on</span> <span class="title">disk1s1</span></span><br><span class="line">Unmounting Volume <span class="string">"Preboot"</span> <span class="keyword">on</span> <span class="title">disk1s2</span></span><br><span class="line">Unmounting Volume <span class="string">"Recovery"</span> <span class="keyword">on</span> <span class="title">disk1s3</span></span><br><span class="line">Unmounting Volume <span class="string">"VM"</span> <span class="keyword">on</span> <span class="title">disk1s4</span></span><br><span class="line">Deleting Volumes</span><br><span class="line">Deleting Container</span><br><span class="line">Wiping former APFS disks</span><br><span class="line">Switching content types</span><br><span class="line">Reformatting former APFS disks</span><br><span class="line">Initialized /dev/rdisk0s10 <span class="keyword">as</span> <span class="keyword">a</span> <span class="number">27</span> GB <span class="keyword">case</span>-insensitive HFS Plus volume <span class="keyword">with</span> <span class="keyword">a</span> <span class="number">8192</span>k journal</span><br><span class="line">Mounting disk</span><br><span class="line"><span class="number">1</span> <span class="built_in">new</span> disk created <span class="keyword">or</span> changed due <span class="built_in">to</span> APFS operation</span><br><span class="line">Disk <span class="built_in">from</span> APFS operation: disk0s10</span><br><span class="line">Finished APFS operation <span class="keyword">on</span> <span class="title">disk1</span></span><br></pre></td></tr></table></figure><h2 id="检查"><a class="markdownIt-Anchor" href="#检查"></a> 检查：</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">diskutil list</span><br></pre></td></tr></table></figure><p>/dev/disk0(internal, physical):</p><table><thead><tr><th>#:</th><th style="text-align:right">TYPE</th><th style="text-align:left">NAME</th><th>SIZE</th><th>IDENTIFIER</th></tr></thead><tbody><tr><td>0:</td><td style="text-align:right">GUID_partition_scheme</td><td style="text-align:left"></td><td>512 GB</td><td>disk0</td></tr><tr><td>1:</td><td style="text-align:right">EFI</td><td style="text-align:left">EFI</td><td>200 MB</td><td>disk0s1</td></tr><tr><td>2:</td><td style="text-align:right">Apple_HFS</td><td style="text-align:left">MAC</td><td>128 GB</td><td>disk0s2</td></tr><tr><td>…</td><td style="text-align:right">…</td><td style="text-align:left">…</td><td>…</td><td>…</td></tr><tr><td>8:</td><td style="text-align:right">Apple_HFS</td><td style="text-align:left">test</td><td>29.1 GB</td><td>disk0s10</td></tr></tbody></table><p>可以看到test的分区格式已经变回<code>hfs+</code>了。</p><p>本教程结束，更多的命令用法请使用命令：<code>man diskutil</code></p><h2 id="收工-2"><a class="markdownIt-Anchor" href="#收工-2"></a> 收工</h2><h1 id="如何开启原生ssd-trim功能"><a class="markdownIt-Anchor" href="#如何开启原生ssd-trim功能"></a> 如何开启原生SSD Trim功能</h1><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo trimforce <span class="built_in">enable</span></span><br></pre></td></tr></table></figure><p>因为是系统原生工具，此方法无需开启rootless=0，更不会改变已有驱动的签名，也就是说不需要kext-dev-mode=1，白果也可用此方法开启Trim。</p><h1 id="不使用任何程序教你提取显示器的edid解决笔记本显示器内屏黑屏花屏的问题"><a class="markdownIt-Anchor" href="#不使用任何程序教你提取显示器的edid解决笔记本显示器内屏黑屏花屏的问题"></a> 不使用任何程序教你提取显示器的EDID，解决笔记本显示器内屏黑屏/花屏的问题</h1><blockquote><p>经常有网友需要解决笔记本显示器内屏黑屏问题，尤其新发布的10.13的系统会出现睡眠唤醒后屏幕花屏问题。</p></blockquote><p>目前最简单的方案就是通过clover注入显示器的EDID信息，之前网上的教程都是使用Windows下的应用程序进行操作。<br>其实显示器的EDID信息都会在显卡正确驱动后存在于ioreg中的。</p><h2 id="最简单的命令是"><a class="markdownIt-Anchor" href="#最简单的命令是"></a> 最简单的命令是：</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ioreg -lw0 | grep -i <span class="string">"IODisplayEDID"</span> | sed -e <span class="string">'s/.*&lt;//'</span> -e <span class="string">'s/&gt;//'</span></span><br></pre></td></tr></table></figure><h2 id="显示信息如下"><a class="markdownIt-Anchor" href="#显示信息如下"></a> 显示信息如下：</h2><p><code>00ffffffffffff000daee01500000000161a0104952213780228659759548e271e505400000001010101010101010101010101010101b43b804a713834405036680058c11000001ac32f804a713834405036680058c11000001a000000fe0035324b4636803135364843410a000000000000413196011000000a010a202000e8</code></p><h2 id="接着输入下面的两条命令"><a class="markdownIt-Anchor" href="#接着输入下面的两条命令"></a> 接着输入下面的两条命令：</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">ioreg -l | grep <span class="string">"DisplayVendorID"</span>  </span><br><span class="line">    <span class="string">"DisplayVendorID"</span> = 3502</span><br><span class="line">    </span><br><span class="line">ioreg -l | grep <span class="string">"DisplayProductID"</span>  </span><br><span class="line">    <span class="string">"DisplayProductID"</span> = 5600</span><br></pre></td></tr></table></figure><p>其中&lt;&gt;里面的内容就是显示器的EDID信息，将提取出来的EDID信息粘贴到clover的 <code>config.plist</code> 中，顺便将 <code>VendorID</code> 和 <code>ProductID</code> 填入相应的位置，然后保存重启你的电脑。<br><img src="https://pics.daliansky.net/d/xD0Ar91B/blog/EDID%E6%B3%A8%E5%85%A5.png?download=1" alt="EDID注入"></p><h1 id="macos系统下导出man手册内容"><a class="markdownIt-Anchor" href="#macos系统下导出man手册内容"></a> MacOS系统下导出man手册内容</h1><p>经常使用shell命令的时候需要翻看man查询命令的用法以及参数，想把使用手册导出来查看。比如我想查看10.13系统下 <code>log show</code>命令的具体用法，使用以下命令：</p><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">man <span class="built_in">log</span> | col -b &gt; ~/Desktop/log_manual.txt</span><br></pre></td></tr></table></figure><ul><li>命令中 <code>col -b</code>是导出一个纯文本版本格式的手册且显示正常</li></ul><h1 id="使用log-show检查applealc和lilu是否工作正常"><a class="markdownIt-Anchor" href="#使用log-show检查applealc和lilu是否工作正常"></a> 使用log show检查AppleALC和Lilu是否工作正常</h1><p>(内容暂未添加)<br>命令格式：<br><code>log show --predicate 'process == &quot;kernel&quot; AND (eventMessage CONTAINS &quot;AppleALC&quot; OR eventMessage CONTAINS &quot;Lilu&quot;)' --style syslog --source</code></p><h1 id="一条命令教你如何确认自己的机型及如何开启-hwp"><a class="markdownIt-Anchor" href="#一条命令教你如何确认自己的机型及如何开启-hwp"></a> 一条命令教你如何确认自己的机型及如何开启 <code>HWP</code></h1><blockquote><p>HWP是什么？HWP是Hardware Work Package的简称，翻译过来叫做：硬件标准部件<br>在macOS下,HWP是指Intel SpeedShift，开启全功率的电源管理，更多的解释请参阅<a href="http://www.insanelymac.com/forum/topic/321021-guide-hwpintel-speed-shift-enable-with-full-power-management/" target="_blank" rel="noopener">原文</a></p></blockquote><ul><li><p>用到的工具： <code>freqVectorsEdit.sh</code></p></li><li><p>用法：</p><ul><li>打开终端，复制下面命令：</li></ul><p><code>cd /tmp &amp;&amp; curl -s https://raw.githubusercontent.com/Piker-Alpha/freqVectorsEdit.sh/master/freqVectorsEdit.sh &gt; /tmp/freqVectorsEdit.sh &amp;&amp; chmod +x freqVectorsEdit.sh &amp;&amp; /tmp/freqVectorsEdit.sh &amp;&amp; sudo rm -rf /tmp/freqVectorsEdit.sh &amp;&amp; sudo rm -rf /tmp/Mac-*.bin</code></p><ul><li><strong>注意上面的命令为一条，须全部复制</strong></li><li>系统会使用 <code>curl</code> 自动下载一个程序，保存到 <code>/tmp</code> ,之后自动执行，期间需要你输入自己的用户密码，程序执行完后会自动清除临时文件；</li><li>屏幕会输出40个机型，其中亮白加粗为你当时设置的机型，带 <code>绿色</code> 显示的那三行前面括号里的机型为可选机型，带 <code>HWP</code> 字样的为可以开启 <code>HWPEnable</code><br><img src="https://pics.daliansky.net/d/xD0Ar91B/blog/HWP.png?download=1" alt="HWP"></li><li>输入方括号里面的数字并回车，可以修改相对应的机型，同时开启 <code>HWP</code></li><li>本文不讨论开启 <code>HWP</code> 的步骤及用法，更多的信息请参阅其它文章</li></ul></li></ul><h1 id="检查自己的显卡驱动所使用的platform-id"><a class="markdownIt-Anchor" href="#检查自己的显卡驱动所使用的platform-id"></a> 检查自己的显卡驱动所使用的<code>platform-id</code></h1><p>打开终端,输入命令:</p><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ioreg -l | grep -y platform-id</span><br></pre></td></tr></table></figure><p>显示输出信息:</p><figure class="highlight ruby"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="params">| |</span>   <span class="params">| |</span>   <span class="string">"AAPL,ig-platform-id"</span> = &lt;<span class="number">0000165</span>9&gt;</span><br></pre></td></tr></table></figure><p>进行一次小端转换,就是:<code>59160000</code>,也就是七代核显<code>Intel HD Graphics 620</code>的显卡注入信息.</p><h1 id="笔记本开启插电源出提示音"><a class="markdownIt-Anchor" href="#笔记本开启插电源出提示音"></a> 笔记本开启插电源出提示音:</h1><h2 id="开启"><a class="markdownIt-Anchor" href="#开启"></a> 开启:</h2><p>打开终端,输入以下命令:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">defaults write com.apple.PowerChime ChimeOnAllHardware -bool <span class="literal">true</span>; open /System/Library/CoreServices/PowerChime.app &amp;</span><br></pre></td></tr></table></figure><h2 id="关闭"><a class="markdownIt-Anchor" href="#关闭"></a> 关闭:</h2><p>打开终端,输入以下命令:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">defaults write com.apple.PowerChime ChimeOnAllHardware -bool <span class="literal">false</span>; killall PowerChime</span><br></pre></td></tr></table></figure><h1 id="如何去掉apfsefi最新版本的日志调试显示"><a class="markdownIt-Anchor" href="#如何去掉apfsefi最新版本的日志调试显示"></a> 如何去掉<code>apfs.efi</code>最新版本的日志调试显示</h1><h2 id="打开终端输入以下命令"><a class="markdownIt-Anchor" href="#打开终端输入以下命令"></a> 打开终端，输入以下命令：</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> ~/Desktop							<span class="comment"># 进入当前用户桌面</span></span><br><span class="line">cp /usr/standalone/i386/apfs.efi .		<span class="comment"># 复制最新版本的apfs.efi到当前目录</span></span><br><span class="line">perl -i -pe <span class="string">'s|\x00\x74\x07\xb8\xff\xff|\x00\x90\x90\xb8\xff\xff|sg'</span> ./apfs.efi	<span class="comment"># 去掉日志调试回显</span></span><br></pre></td></tr></table></figure><h2 id="将生成的apfsefi复制到eficloverdrivers64uefi目录下重启测试"><a class="markdownIt-Anchor" href="#将生成的apfsefi复制到eficloverdrivers64uefi目录下重启测试"></a> 将生成的apfs.efi复制到<code>/EFI/CLOVER/drivers64UEFI</code>目录下，重启测试</h2><h2 id="查看声卡型号及注入的id以及configdata"><a class="markdownIt-Anchor" href="#查看声卡型号及注入的id以及configdata"></a> 查看声卡型号及注入的ID以及ConfigData</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ioreg -l | grep ALC | grep HDAConfigDefault</span><br></pre></td></tr></table></figure><p>屏幕输出：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"HDAConfigDefault"</span> = (&#123;<span class="string">"AFGLowPowerState"</span>=&lt;03000000&gt;,<span class="string">"CodecID"</span>=283902550,<span class="string">"ConfigData"</span>=&lt;01470c02&gt;,<span class="string">"FuncGroup"</span>=1,<span class="string">"Codec"</span>=<span class="string">"DalianSky - Realtek ALC256 (3246) for Dell 7000 Series"</span>,<span class="string">"WakeVerbReinit"</span>=Yes,<span class="string">"LayoutID"</span>=7,<span class="string">"BootConfigData"</span>=&lt;01271c3001271d0101271ea601271f9001371cf001371d0001371e0001371f4001471c1001471d0101471e1701471f9001470c0201871cf001871d0001871e0001871f4001971c4001971d1001971e8101971f0201a71cf001a71d0001a71e0001a71f4001b71cf001b71d0001b71e0001b71f4001d71cf001d71d0001d71e0001d71f4001e71cf001e71d0001e71e0001e71f4002171c2002171d1002171e2102171f0202170c02&gt;&#125;)</span><br></pre></td></tr></table></figure><h1 id="一键查询硬件信息"><a class="markdownIt-Anchor" href="#一键查询硬件信息"></a> 一键查询硬件信息：</h1><p>打开终端，输入命令：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sh -c <span class="string">"<span class="variable">$(curl -fsSL https://raw.githubusercontent.com/daliansky/dell7000/master/Tools/archey)</span>"</span></span><br></pre></td></tr></table></figure><p>输出结果：</p><p><img src="https://pics.daliansky.net/d/xD0Ar91B/blog/archey.png?download=1" alt="archey"></p><blockquote><p>备注：脚本中调用了bdmesg获取主板型号，所以使用前请勾选安装CLOVER的RC Scripts</p></blockquote><h2 id="收工-3"><a class="markdownIt-Anchor" href="#收工-3"></a> 收工</h2><h1 id="未完待续"><a class="markdownIt-Anchor" href="#未完待续"></a> ———— 未完待续 ————</h1><h1 id="关于打赏"><a class="markdownIt-Anchor" href="#关于打赏"></a> 关于打赏</h1><p>您的支持就是我更新的动力！<br>如果不希望看到博主停更的话，请点击下方的 <code>打赏</code> 支持一下，有钱的捧个钱场，没钱的捧个人场，谢谢大家！</p></div><div><div id="wechat_subscriber" style="display:block;padding:10px 0;margin:20px auto;width:100%;text-align:center"><img id="wechat_subscriber_qcode" src="/uploads/WeChatandShop.png" alt="黑果小兵 wechat" style="max-width:90%"><div>微信扫一扫，订阅/直达【黑果小兵的部落阁】</div></div></div><div class="updated"><svg xmlns="http://www.w3.org/2000/svg" width="130" height="20"><lineargradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></lineargradient><clippath id="a"><rect width="130" height="20" rx="3" fill="#fff"/></clippath><g clip-path="url(#a)"><path fill="#555" d="M0 0h55v20H0z"/><path fill="#97CA00" d="M55 0h75v20H55z"/><path fill="url(#b)" d="M0 0h130v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="Menlo,monospace" font-size="110"><text x="285" y="150" fill="#010101" fill-opacity=".3" textlength="450" transform="scale(.1)">更新日期</text><text x="285" y="140" textlength="450" transform="scale(.1)">更新日期</text><text x="915" y="150" fill="#010101" fill-opacity=".3" textlength="650" transform="scale(.1)">2021-12-06</text><text x="915" y="140" textlength="650" transform="scale(.1)">2021-12-06</text></g></svg></div><div><div><div style="text-align:center;color:#ccc;font-size:14px">-------------本文结束<i class="fa fa-apple"></i>感谢您的阅读-------------</div></div></div><div><div style="padding:10px 0;margin:20px auto;width:90%;text-align:center"><button id="rewardButton" disable="enable" onclick='var qr=document.getElementById("QR");"none"===qr.style.display?qr.style.display="block":qr.style.display="none"'><span>打赏</span></button><div>如果文章对您有帮助，就请站长喝杯咖啡吧 ´◡`</div><div id="QR" style="display:none"><div id="wechat" style="display:inline-block"><img id="wechat_qr" src="/images/wechatpay.jpg" alt="黑果小兵 微信支付"><p>微信支付</p></div><div id="alipay" style="display:inline-block"><img id="alipay_qr" src="/images/alipay.jpg" alt="黑果小兵 支付宝"><p>支付宝</p></div></div></div></div><div><div><ul class="qq-qun"><div><p></p><h2>QQ群列表：</h2><p></p><p>630724380 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=JyGkfKK7U3Xq3TDtpqKOTq_gW7SBg4Uh&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群7</a> 2000人 新开群<br>713810838 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=e8E-1Ge2lCoBSTlj8Y4zMxX7l7-V63Iv&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群8</a> 2000人 新开群<br>688324116 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=Fp4HZ5e8A61oCu0GMS5YUqP6COc43-AO&jump_from=webapi" target="_blank" rel="noopener">一起黑苹果</a> 2000人<br>331686786 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=No8zvDfvDicT-GfSApw1RMBI-3MQ7zM3&jump_from=webapi" target="_blank" rel="noopener">一起吃苹果</a> 2000人<br>257995340 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=acztqL9efoqAOoptc_3moZ9b3Sgczu9_&jump_from=webapi" target="_blank" rel="noopener">一起啃苹果</a> 2000人群 远景报备群<br>875482673 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=aZNyoRum_er2mruqmnbX_93ncHNgsyak&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群</a> 2000人<br>1058822256 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=1sIT0BDaejgr9t1Hlw16cMnw_Z96zleV&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群2</a> 2000人<br>819662911 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=aJx9xO7vAmyslCuOdK0bRMmDLpvOCeRw&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群3</a> 2000人<br>954098809 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=iu042k0X5snr--dzAxOzcsvD9Zft9yx7&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群4</a> 2000人<br>1161377948 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=kBV9vCnz-NqtXXJiwnUhaLyJN1D7G0n6&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群5</a> 2000人<br>553283949 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=kr_hZc5pKK4TCDRaFPwRlfAiB4528InP&jump_from=webapi" target="_blank" rel="noopener">黑果小兵黑苹果技术群6</a> 2000人<br>701278330 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=x57TlUmxz88oXGDWjMOOsWokYi8klE11&jump_from=webapi" target="_blank" rel="noopener">黑苹果无线网卡交流群</a> 1000人群 DW1820A技术支持群<br>891434070 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=TUAxSUUtw_T1N62V0kF1sWvMcDr_eoxc&jump_from=webapi" target="_blank" rel="noopener">Catalina黑苹果交流群</a> 2000人群 远景报备群<br>939122730 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=g_rpf7m0LJllE6WHY9c0gVvCTBm1MtuN&jump_from=webapi" target="_blank" rel="noopener">Catalina黑苹果交流II群</a> 2000人群<br>891677227 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=xsuIOzF7RXYaRTTbJ5o_UjzohRDUx5UY&jump_from=webapi" target="_blank" rel="noopener">黑果小兵高级群</a> 2000人群<br>943307869 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=aoSvqrbysdjPo0Wa_XvvPuMG9NMEtOie&jump_from=webapi" target="_blank" rel="noopener">黑果小兵高级群II</a> 2000人群<br>275356796 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=H7hFwiVkZq71L7se6rz3hE9QcacqL-dV&jump_from=webapi" target="_blank" rel="noopener">morefine黑苹果技术交流群</a> 500人群 非专用机型请勿加入<br>869792897 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=MTDHb2QgLH3gkaymtdFCpk77J5ufWJpH&jump_from=webapi" target="_blank" rel="noopener">minisforum U820黑苹果技术群</a> 500人群 非专用机型请勿加入<br>942112153 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=N5cjw5ksrnmk-RMQ4fPCOo5D_Dxiu47B&jump_from=webapi" target="_blank" rel="noopener">天逸510s Mini黑苹果交流群</a> 1000人群 非专用机型请勿加入<br>673294583 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=GgcMJM5-98yB-fc6zyGcTI3OuesrSBRk&jump_from=webapi" target="_blank" rel="noopener">小新Pro黑苹果技术群</a> 2000人群 非专用机型请勿加入<br>946132482 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=r-m99xC-BPIRdVkEjU6duvqXMJ-1FOwA&jump_from=webapi" target="_blank" rel="noopener">小新Pro黑苹果</a> 500人群 非专用机型请勿加入<br>158976808 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=c9DeeyUg9x4dZlOpIVmj4R4g38p-YCZ1&jump_from=webapi" target="_blank" rel="noopener">DELL黑苹果交流群</a> 1000人群 非专用机型请勿加入<br>247451054 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=h7fvRnWmdaMK2D0qVQLzJsjCC9PwB5h3&jump_from=webapi" target="_blank" rel="noopener">小米Pro黑苹果高级群</a> 2000人群 非专用机型请勿加入<br>943181023 <a href="https://qm.qq.com/cgi-bin/qm/qr?k=OGO_GSX9ZhtbQ_HNns57Vdxm5pR1wH6V&jump_from=webapi" target="_blank" rel="noopener">联想小新Air黑苹果交流群</a> 500人群 非专用机型请勿加入<br></p><p></p><h2>Telegram群：</h2><p></p><p>黑果小兵的部落阁 <a href="http://t.me/daliansky" target="_blank">http://t.me/daliansky</a><br>黑果小兵的部落阁 #安装问题讨论 <a href="https://t.me/macos_installer" target="_blank">https://t.me/macos_installer</a></p></div></ul></div></div><div><ul class="post-copyright"><li class="post-copyright-author"><strong>本文作者： </strong>黑果小兵</li><li class="post-copyright-link"><strong>本文链接：</strong> <a href="https://blog.daliansky.net/Mac-frequently-used-to-the-command---continuous-update.html" title="Mac常用到的命令[持续更新]">https://blog.daliansky.net/Mac-frequently-used-to-the-command---continuous-update.html</a></li><li class="post-copyright-license"><strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！</li></ul></div><footer class="post-footer"><div class="post-tags"><a href="/tags/diskutil/" rel="tag"><i class="fa fa-tag"></i> diskutil</a> <a href="/tags/shell/" rel="tag"><i class="fa fa-tag"></i> shell</a> <a href="/tags/spctl/" rel="tag"><i class="fa fa-tag"></i> spctl</a> <a href="/tags/trimforce/" rel="tag"><i class="fa fa-tag"></i> trimforce</a> <a href="/tags/ioreg/" rel="tag"><i class="fa fa-tag"></i> ioreg</a> <a href="/tags/EDID/" rel="tag"><i class="fa fa-tag"></i> EDID</a> <a href="/tags/APFS/" rel="tag"><i class="fa fa-tag"></i> APFS</a> <a href="/tags/HFS/" rel="tag"><i class="fa fa-tag"></i> HFS+</a></div><div class="post-nav"><div class="post-nav-next post-nav-item"><a href="/Do-not-need-to-make-installation-disk-Teach-you-to-install-the-High-Sierra-system-on-another-MacOS-system-to-another-partition.html" rel="next" title="不需要制作安装盘！教你在MacOS系统下安装High Sierra系统到另一个分区"><i class="fa fa-chevron-left"></i> 不需要制作安装盘！教你在MacOS系统下安装High Sierra系统到另一个分区</a></div><span class="post-nav-divider"></span><div class="post-nav-prev post-nav-item"><a href="/Use-CodecCommander-to-solve-ALC1220-sleep-wake-up-silentr.html" rel="prev" title="使用CodecCommander解决ALC1220唤醒无声">使用CodecCommander解决ALC1220唤醒无声 <i class="fa fa-chevron-right"></i></a></div></div></footer></div></article></div></div><div id="gitalk-container"></div></div><div class="sidebar-toggle"><div class="sidebar-toggle-line-wrap"><span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span></div></div><aside id="sidebar" class="sidebar"><div id="sidebar-dimmer"></div><div class="sidebar-inner"><ul class="sidebar-nav motion-element"><li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">文章目录</li><li class="sidebar-nav-overview" data-target="site-overview-wrap">站点概览</li></ul><div class="site-overview-wrap sidebar-panel"><div class="site-overview"><div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"><a href="/"><img class="site-author-image" itemprop="image" src="/images/avatar.png" alt="黑果小兵"></a><p class="site-author-name" itemprop="name">黑果小兵</p><p class="site-description motion-element" itemprop="description">黑果小兵</p></div><nav class="site-state motion-element"><div class="site-state-item site-state-posts"><a href="/archives/"><span class="site-state-item-count">117</span> <span class="site-state-item-name">日志</span></a></div><div class="site-state-item site-state-categories"><a href="/categories/index.html"><span class="site-state-item-count">26</span> <span class="site-state-item-name">分类</span></a></div><div class="site-state-item site-state-tags"><a href="/tags/index.html"><span class="site-state-item-count">264</span> <span class="site-state-item-name">标签</span></a></div></nav><div class="feed-link motion-element"><a href="/atom.xml" rel="alternate"><i class="fa fa-rss"></i> RSS</a></div><div class="links-of-author motion-element"><span class="links-of-author-item"><a href="https://github.com/daliansky" title="GitHub &rarr; https://github.com/daliansky" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i></a> </span><span class="links-of-author-item"><a href="http://www.jianshu.com/u/df9143008845" title="简书 &rarr; http://www.jianshu.com/u/df9143008845" rel="noopener" target="_blank"><i class="fa fa-fw fa-heartbeat"></i></a> </span><span class="links-of-author-item"><a href="http://shang.qq.com/wpa/qunwpa?idkey=db511a29e856f37cbb871108ffa77a6e79dde47e491b8f2c8d8fe4d3c310de91" title="QQ &rarr; http://shang.qq.com/wpa/qunwpa?idkey=db511a29e856f37cbb871108ffa77a6e79dde47e491b8f2c8d8fe4d3c310de91" rel="noopener" target="_blank"><i class="fa fa-fw fa-qq"></i></a></span></div><div class="links-of-blogroll motion-element links-of-blogroll-block"><div class="links-of-blogroll-title"><i class="fa fa-fw fa-link"></i> Links</div><ul class="links-of-blogroll-list"><li class="links-of-blogroll-item"><a href="https://blog.tlhub.cn" title="https://blog.tlhub.cn" rel="noopener" target="_blank">Athlonreg</a></li><li class="links-of-blogroll-item"><a href="http://www.sqlsec.com" title="http://www.sqlsec.com" rel="noopener" target="_blank">国光</a></li></ul></div></div></div><div class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active"><div class="post-toc"><div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#mac常用命令"><span class="nav-number">1.</span> <span class="nav-text">Mac常用命令</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#序言"><span class="nav-number">1.1.</span> <span class="nav-text">序言</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#隐藏允许任何来源的应用选项问题"><span class="nav-number">2.</span> <span class="nav-text">隐藏“允许任何来源的应用”选项问题</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#重建缓存的命令"><span class="nav-number">3.</span> <span class="nav-text">重建缓存的命令</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#磁盘分区的基本操作教你将u盘上的efi复制到磁盘的efi分区"><span class="nav-number">4.</span> <span class="nav-text">磁盘分区的基本操作：教你将U盘上的EFI复制到磁盘的EFI分区</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#查看磁盘分区表"><span class="nav-number">4.1.</span> <span class="nav-text">查看磁盘分区表</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#挂载磁盘efi分区"><span class="nav-number">4.2.</span> <span class="nav-text">挂载磁盘EFI分区</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#挂载u盘efi分区"><span class="nav-number">4.3.</span> <span class="nav-text">挂载U盘EFI分区</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#打开finder注意后面有个"><span class="nav-number">4.4.</span> <span class="nav-text">打开Finder，注意后面有个.</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#收工"><span class="nav-number">4.5.</span> <span class="nav-text">收工</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#磁盘分区的进阶操作教你将apfs分区转换回hfs"><span class="nav-number">5.</span> <span class="nav-text">磁盘分区的进阶操作：教你将apfs分区转换回hfs+</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#diskutil命令的进阶操作"><span class="nav-number">5.1.</span> <span class="nav-text">diskutil命令的进阶操作</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#命令"><span class="nav-number">5.2.</span> <span class="nav-text">命令：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#检查"><span class="nav-number">5.3.</span> <span class="nav-text">检查：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#收工-2"><span class="nav-number">5.4.</span> <span class="nav-text">收工</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#如何开启原生ssd-trim功能"><span class="nav-number">6.</span> <span class="nav-text">如何开启原生SSD Trim功能</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#不使用任何程序教你提取显示器的edid解决笔记本显示器内屏黑屏花屏的问题"><span class="nav-number">7.</span> <span class="nav-text">不使用任何程序教你提取显示器的EDID，解决笔记本显示器内屏黑屏/花屏的问题</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#最简单的命令是"><span class="nav-number">7.1.</span> <span class="nav-text">最简单的命令是：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#显示信息如下"><span class="nav-number">7.2.</span> <span class="nav-text">显示信息如下：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#接着输入下面的两条命令"><span class="nav-number">7.3.</span> <span class="nav-text">接着输入下面的两条命令：</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#macos系统下导出man手册内容"><span class="nav-number">8.</span> <span class="nav-text">MacOS系统下导出man手册内容</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#使用log-show检查applealc和lilu是否工作正常"><span class="nav-number">9.</span> <span class="nav-text">使用log show检查AppleALC和Lilu是否工作正常</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#一条命令教你如何确认自己的机型及如何开启-hwp"><span class="nav-number">10.</span> <span class="nav-text">一条命令教你如何确认自己的机型及如何开启 HWP</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#检查自己的显卡驱动所使用的platform-id"><span class="nav-number">11.</span> <span class="nav-text">检查自己的显卡驱动所使用的platform-id</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#笔记本开启插电源出提示音"><span class="nav-number">12.</span> <span class="nav-text">笔记本开启插电源出提示音:</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#开启"><span class="nav-number">12.1.</span> <span class="nav-text">开启:</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#关闭"><span class="nav-number">12.2.</span> <span class="nav-text">关闭:</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#如何去掉apfsefi最新版本的日志调试显示"><span class="nav-number">13.</span> <span class="nav-text">如何去掉apfs.efi最新版本的日志调试显示</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#打开终端输入以下命令"><span class="nav-number">13.1.</span> <span class="nav-text">打开终端，输入以下命令：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#将生成的apfsefi复制到eficloverdrivers64uefi目录下重启测试"><span class="nav-number">13.2.</span> <span class="nav-text">将生成的apfs.efi复制到/EFI/CLOVER/drivers64UEFI目录下，重启测试</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#查看声卡型号及注入的id以及configdata"><span class="nav-number">13.3.</span> <span class="nav-text">查看声卡型号及注入的ID以及ConfigData</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#一键查询硬件信息"><span class="nav-number">14.</span> <span class="nav-text">一键查询硬件信息：</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#收工-3"><span class="nav-number">14.1.</span> <span class="nav-text">收工</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#未完待续"><span class="nav-number">15.</span> <span class="nav-text">———— 未完待续 ————</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#关于打赏"><span class="nav-number">16.</span> <span class="nav-text">关于打赏</span></a></li></ol></div></div></div></div></aside></div></main><footer id="footer" class="footer"><div class="footer-inner"><div class="copyright"><a href="http://www.beian.miit.gov.cn" rel="noopener" target="_blank">辽ICP备15000696号-3 </a>&copy; 2016 – <span itemprop="copyrightYear">2021</span> <span class="with-love" id="animate"><i class="fa fa-apple"></i> </span><span class="author" itemprop="copyrightHolder">黑果小兵</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="fa fa-area-chart"></i> </span><span title="站点总字数">795k</span> <span class="post-meta-divider">|</span> <span class="post-meta-item-icon"><i class="fa fa-coffee"></i> </span><span title="站点阅读时长">24:05</span></div><div class="busuanzi-count"><script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><span class="site-uv" title="总访客量"><i class="fa fa-user"></i> <span class="busuanzi-value" id="busuanzi_value_site_uv"></span> </span><span class="site-pv" title="总访问量"><i class="fa fa-eye"></i> <span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span></div></div></footer><div class="back-to-top"><i class="fa fa-arrow-up"></i> <span id="scrollpercent"><span>0</span>%</span></div></div><script>"[object Function]"!==Object.prototype.toString.call(window.Promise)&&(window.Promise=null)</script><script src="/lib/jquery/index.js?v=2.1.3"></script><script src="/lib/velocity/velocity.min.js?v=1.2.1"></script><script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.2.5/dist/jquery.fancybox.min.js"></script><script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-reading-progress@1.1/reading_progress.min.js"></script><script src="/js/src/utils.js?v=6.6.0"></script><script src="/js/src/motion.js?v=6.6.0"></script><script src="/js/src/scrollspy.js?v=6.6.0"></script><script src="/js/src/post-details.js?v=6.6.0"></script><script src="/js/src/bootstrap.js?v=6.6.0"></script><script src="//cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.min.js"></script><link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1.7.2/dist/gitalk.css"><script src="//cdn.jsdelivr.net/npm/js-md5@0.7.3/src/md5.min.js"></script><script>var gitalk=new Gitalk({clientID:"0da3e792a21a77938da6",clientSecret:"4d2869563000629ee6dbed48fbbf878aea151cb6",repo:"daliansky.github.io",owner:"daliansky",admin:["daliansky"],id:md5(location.pathname),distractionFreeMode:"true",proxy:"https://gitalk.daliansky.workers.dev/?https://github.com/login/oauth/access_token"});gitalk.render("gitalk-container")</script><script>// Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });</script><script src="/js/src/js.cookie.js?v=6.6.0"></script><script src="/js/src/scroll-cookie.js?v=6.6.0"></script><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({pluginRootPath:"live2dw/",pluginJsPath:"lib/",pluginModelPath:"assets/",model:{scale:1.2,hHeadPos:.5,vHeadPos:.618,jsonPath:"/live2dw/assets/tororo.model.json"},display:{superSample:2,width:150,height:300,position:"right",hOffset:0,vOffset:-20},mobile:{show:!1,scale:.5},react:{opacityDefault:.7,opacityOnHover:.2},log:!1,tagMode:!1})</script></body></html>